package team526.dao;

import org.apache.ibatis.annotations.Mapper;
import team526.entity.Favorite;
import team526.entity.History;
import team526.entity.User;
import team526.entity.Video;

import java.sql.Time;
import java.util.Date;
import java.util.List;

@Mapper
public interface UserDao {
    List<User> getAllUser();

    User getUserById(Integer id);

    Integer insertUser(User user);

    Integer updateUser(User user);

    Integer deleteUser(Integer id);

    List<User> getUserByIdWithVideos(Integer id);

    List<User> getUserByIdWithComments(Integer id);

    List<User> getUserByIdWithHistories(Integer id);

    List<User> getUserByIdWithFavorites(Integer id);

    List<User> getUserByIdWithReports(Integer id);

    List<User> getUserByIdWithSubscribes(Integer id);



    List<User> search(String username, Integer down, Integer up, Integer status);

    User getUserInfo(Integer uuid);

    User login(User user);


    Integer createUser(String email, String info, String name, String pwd);

    User getByEmail(String email);



    Integer subs(Integer uuid, Integer uuid1);

    Integer cancelSub(Integer uuid, Integer uuid1);

    List<User> getSubs(Integer uuid, Integer start, Integer num);

    Integer likeVideo(Integer uuid, Integer videoid);

    Integer unlikeVideo(Integer uuid, Integer videoid);

    Integer favorite(Integer uuid, Integer videoid, Date time);

    List<Favorite> getFavorite(Integer uuid);

    Integer deleteF(List<Favorite> favorites);

    Integer deleteH(List<History> favorites);

    List<History> getHistory(Integer uuid);

    Object getLike(Integer uuid, Integer videoid);

    Object ifFavorite(Integer uuid, Integer videoid);


    Integer deleteFbyPk(List<Integer> videoIds);

    Integer deleteHbyPk(List<Integer> videoIds,Integer uuid);

    Object ifSub(Integer uuid, Integer suid);

    Integer deleteFbyVideoId(Integer uuid,List<Integer> videoIds);

    User getByName(String username);

    List<Video> getManageList(Integer uuid,Integer status);

    Integer deleteList(List<Integer> videoIds,Integer uuid);

}
